package tor;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;

public class Cli2
{
    public static void main( String[] args ) throws FileNotFoundException
    {
        System.setErr( new PrintStream( new File( "howdy.txt" ) ) );
        String result = null;
        while( result == null )
        {
            TorSender sender = new TorSender( "ZRYJ TO\r\n" );
            Thread thr = new Thread( sender );
            thr.start();
            try
            {
                Thread.sleep( 30000 );
            }
            catch( Exception e )
            {
            }
            if( sender.isRunning() )
                thr.interrupt();
            result = sender.getResult();
            System.out.println( result );
        }
    }
}
